import React from "react";
import { LayoutIndex } from '../../routers/constant'
import type { RouteObjects } from '../../routers/interface'
import lazyLoad from '../../routers/utils/lazyLoad'

const homeRouter: Array<RouteObjects> = [
  {
    element: <LayoutIndex />,
    meta: {
      title: '表单管理',
    },
    children: [
      {
        path: '/form/basicForm',
        element: lazyLoad(React.lazy(() => import('../../pages/form/baseForm/index'))),
        meta: {
          requiresAuth: true,
          title: '基础表单',
          key: "basicForm"
        }
      },
      {
        path: '/form/dynamicForm',
        element: lazyLoad(React.lazy(() => import('../../pages/form/dynamicForm/index'))),
        meta: {
          requiresAuth: true,
          title: '动态表单',
          key: "dynamicForm"
        }
      }
    ]
  }
]

export default homeRouter